package com.roa.web.usuario;


import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.roa.generics.json.ExtJSReturn;
import com.roa.model.usuario.Usuario;
import com.roa.service.usuario.UsuarioSVC;
import com.roa.web.crud.IControllable;


@Controller
@RequestMapping("usuario")
public class UsuarioCTL implements IControllable<Usuario> {
	
	private UsuarioSVC usuarioSVC = new UsuarioSVC();

	@Override
	@RequestMapping(method = RequestMethod.POST, produces = "application/json")
	@ResponseBody
	public Map<String, Object> create(@RequestBody List<Usuario> obj) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	@RequestMapping(method = RequestMethod.GET, produces = "application/json")
	@ResponseBody
	public Map<String, Object> read() {

		Map<String, Object> rs = ExtJSReturn.mapOK(usuarioSVC.getUsuarios());
		
		return rs;
	}

	@Override
	@RequestMapping(method = RequestMethod.PUT, produces = "application/json")
	@ResponseBody
	public Map<String, Object> update(@RequestBody List<Usuario> obj) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	@RequestMapping(method = RequestMethod.DELETE, produces = "application/json")
	@ResponseBody
	public Map<String, Object> delete(@RequestBody List<Usuario> obj) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	@RequestMapping(value = "/{param}", method = RequestMethod.GET, produces = "application/json")
	@ResponseBody
	public Map<String, Object> readByParameter(@PathVariable("param") Object id) {
		// TODO Auto-generated method stub
		return null;
	}

	
	
}
